using array_demo.Model.Array;

namespace array_demo.Model.Dictionary
{
    public class ArrayDictionary<Key, Value> : IDictionary<Key, Value> where Key : IComparable<Key>
    {

        private SortArray2<Key, Value>  sortArray2 ;

        public ArrayDictionary()
        {
            sortArray2 = new SortArray2<Key, Value>();
        }


        public bool IsEmpty => sortArray2.IsEmpty;

        public int Count => sortArray2.Count;

        public void Add(Key key, Value value)
        {
           sortArray2.Add(key,value);
        }

        public bool contains(Key key)
        {
           return  sortArray2.Contains(key);
        }

        public Value Get(Key key)
        {
            return  sortArray2.Get(key);
        }

        public void Remove(Key key)
        {
            sortArray2.Remove(key);
        }

        public void Set(Key key, Value value)
        {
            sortArray2.Add(key,value);
        }
    }
}